<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ include file="/jsps/common/taglibs.jsp"%>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://"
			+ request.getServerName() + ":" + request.getServerPort()
			+ path + "/";
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<base href="<%=basePath%>">

<title>账户资金列表</title>

<meta http-equiv="pragma" content="no-cache">
<meta http-equiv="cache-control" content="no-cache">
<meta http-equiv="expires" content="0">
<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
<meta http-equiv="description" content="This is my page">

<link rel="stylesheet" type="text/css"
	href='<c:url value="/css/application.css"/>'>
<link rel="stylesheet" type="text/css"
	href='<c:url value="/css/list.css"/>'>
<link rel="stylesheet" type="text/css"
	href='<c:url value="/css/form.css"/>'>

<script type="text/javascript">
		function frozen(accountNo){
			location.href = '<c:url value="accountMgr?act=frozenAccount"/>&account_no='+accountNo;
		}
		
		function defrost(accountNo){
			location.href = '<c:url value="accountMgr?act=defrostAccount"/>&account_no='+accountNo;
		}
		
		function add(accountNo){
			location.href = '<c:url value="accountMgr?act=inAccount"/>&account_no='+accountNo;
		}
		
		function sub(accountNo){
			location.href = '<c:url value="accountMgr?act=forLoginAccount"/>&account_no='+accountNo;
		}
		
		function validateFrm(){
			with(document.forms[0]){
				if(account_no.value == ''){
					alert("请输入账户编号！");
					account_no.focus();
					return false;
				}
			}
			return true;
		}
	</script>
<style type="text/css">
	body {
			background:url(pics/bg.jpg);
			-webkit-background-size: cover;
			-moz-background-size: cover;
			background-size: cover;
		}
</style>
</head>

<body>

	<div id="wrapper">
		<div id="title">账户查询</div>
		<div id="qryarea">
			<form action=" <c:url value="/accountMgr?act=query"/>" method="post" onSubmit ="return validateFrm();">
				<th>账户编号:</th> 
				<input type="text" name="account_no" size="25" value="${accountno}"> &nbsp;&nbsp;&nbsp; 
				<input type="submit" value=" 查 询 " />
			</form>
		</div>

		<div>
			<table id="listtable" cellpadding="0" cellspacing="0">
				<tr>
					<th>账户编号</th>
					<th>客户编号</th>
					<th>账户金额</th>
					<th>账户状态</th>
					<th>创建时间</th>
					<th>操作员编号</th>
					<th>追加/取出</th>
					<th>冻结/解冻</th>
				</tr>
				<c:forEach var="account" items="${accountList}">
					<tr>
						<td>${ account.accountNo}</td>
						<td>${ account.clientNo}</td>
						<td>${ account.accountAmount}</td>
						<td><c:if test="${ account.accountStatus =='A'}">正常</c:if> 
							<c:if test="${ account.accountStatus =='B'}">冻结</c:if>
						</td>
						<td>${ account.createDate }</td>
						<td>${ account.operCode}</td>
						<td>
							<button style="height=20px;width=50px"
								title="点击追加账户[${ account.accountNo}]的资金"
								onclick="add(${ account.accountNo});"
								<c:if test="${account.accountStatus=='B'}">disabled="false"</c:if>>追加
							</button> &nbsp;
							<button style="height=20px;width=50px"
								title="点击取出账户[${ account.accountNo}]的资金"
								onclick="sub(${ account.accountNo});"
								<c:if test="${account.accountStatus=='B'}">disabled="false"</c:if>>取出
							</button>
						</td>
						<td>
							<button style="height=20px;width=50px"
								title="点击冻结账户[${ account.accountNo}]"
								onclick="frozen(${ account.accountNo});"
								<c:if test="${account.accountStatus=='B'}">disabled="false"</c:if>>冻结
							</button> &nbsp;
							<button style="height=20px;width=50px"
								title="点击解冻账户[${account.accountNo}]"
								onclick="defrost(${ account.accountNo});"
								<c:if test="${account.accountStatus=='A'}">disabled="false"</c:if>>解冻
							</button>
						</td>
					</tr>
				</c:forEach>
			</table>
		</div>
	</div>
</body>

 <c:if test="${not empty check_err}">
			<script type="text/javascript">
			alert('${check_err}');
		</script>
 </c:if>
</html>
